{% extends "reviewers/base.html" %}

{% block title %} Add-on Review Log – Add-ons for Firefox {% endblock %}

{% block content %}

  <div id="log-filter" class="log-filter-outside">
    <form action="{{ url('reviewers.reviewlog') }}" method="get" data-no-csrf>
      <div class="date_range">
        {{ form.start.label_tag() }}
        {{ form.start }}
        {{ form.end.label_tag() }}
        {{ form.end }}
        {{ form.search.label_tag() }}
        {{ form.search }}

        <button type="submit">Filter</button>
      </div>
    </form>
  </div><!-- #log-filter -->

  <h2>Add-on Review Log</h2>

  <div class="listing results"><div class="results-inner controls">
    {% if pager.object_list %}
      <table id="log-listing" class="data-grid">
        <thead>
          <tr class="listing-header">
            <th>Date</th>
            <th>Event</th>
            <th>Reviewer</th>
            <th>&nbsp;</th>
          </tr>
        </thead>
        <tbody>
          {% for item in pager.object_list %}
            <tr{% if item.arguments[0] %} data-addonid="{{ item.arguments[0].id }}"{% endif %}>
              <td>{{ item.created|datetime }}</td>
              <td>
                {% if item.arguments.0 %}
                  {{ item.to_string('reviewlog') }}
                {% else %}
                    Add-on has been deleted.
                {% endif %}
              </td>
              <td>{{ item.user.name }}</td>
              <td>
                <a class="comments show" href="#">Show Comments</a>
                <a class="comments hide" href="#">Hide Comments</a>
              </td>
            </tr>
            <tr class="comments hide">
              <td>&nbsp;</td>
              <td colspan="4">{{ item.details['comments'] }}</td>
            </tr>
            <tr class="hide"><td>{{ item.action }}</td></tr>
          {% endfor %}
        </tbody>
      </table>
    {% else %}
      <p class="no-results">No reviews found for this period.</p>
    {% endif %}

    {% if pager.has_other_pages() %}
      <div class="listing-footer">
        {{ pager|paginator }}
      </div>
    {% endif %}
</div></div>
{% endblock %}
